<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>边框内间距测试</title>
    <style>
        .d1{
            width: 200px;
            height: 200px;
            background-color: #0aa1ed;
            border: 5px solid #ff0000;
            /*设置单方向的边框*/
            border-top: 9px dashed #0000ff;
            border-radius: 50px;
        }
        .d2 {
            width: 200px;
            height: 200px;
            background-color: pink;
            /*默认加边框与内间距都会让元素变大*/
            border: 5px solid magenta;
            padding-left: 50px;
            margin: 30px;
            /*设置边框与内间距不改变元素大小*/
            box-sizing: border-box;
        }
        span{
            background-color: yellow;
        }
        .s2{
            /*行内元素垂直方向的内外间距都不生效，不要用*/
            padding: 50px;
        }


    </style>
</head>
<body>
<div class="d1"></div>
<div class="d2">内间距测试</div>
<hr>
<span>span1</span><span class="s2">span2</span><span>span3</span>
<h1>测试文字</h1>


</body>
</html>